﻿<?php
session_start();
include 'interface.php';
include 'dbconnect.php';
$dbcnx = dbconnect();

$iId = $_POST['id_deleted'];
$type = $_POST['type'];
//echo $iId;


$query2 = sprintf("DELETE FROM newsdb.comments WHERE news_id = %d", $iId);
//echo $query2;
$sResult2 = mysql_query($query2);

$query1 = sprintf("DELETE FROM newsdb.records WHERE id = %d", $iId);
//echo $query1;
$sResult1 = mysql_query($query1);

echo "<html>";
echo "<title>";
  echo "Чатик - Администрирование";
echo "</title>";
echo "<body>";

    echo "<table width = \"100%\" bordercolor = \"green\"><!-- \"#5a009c\" -->";
        drawHeader();
    echo "<tr>";
        echo "<td></td>";
        echo "<td colspan = \"2\" rowspan = \"2\">";	
		 echo "Запись удалена!  ";
		$ref = sprintf("index.php?type=%d", $type);		
         echo "<a href = ";
        echo $ref;
        echo ">Назад</a>";		
        echo "</td>";
        echo "</tr>";
    echo "</table>";   
echo "</body>";	
echo "</html>";

?>